package handler

import (
	"github.com/gin-gonic/gin"
	"net/http"
	"short_video/api/request"
	"short_video/consts"
	"short_video/queue"
)

func Admin(c *gin.Context) {
	var req request.Admin

	if err := c.ShouldBind(&req); err != nil {
		c.JSON(http.StatusOK, gin.H{
			"code": 10000,
			"msg":  "参数信息失败",
			"data": err.Error(),
		})
		return
	}
	queue.QueuePub(consts.Queue_All, req.Message)

	c.JSON(http.StatusOK, gin.H{
		"code": 10000,
		"msg":  "在线用户发送公告成功",
		"data": true,
	})
}
